# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-audioencoder-lame
pkgver=19.1.2
_realname=Matrix
pkgrel=0
pkgdesc="Lame MP3 encoder addon for Kodi"
options="!check" # no test suite
url="https://github.com/xbmc/audioencoder.lame"
arch="x86 x86_64 aarch64 armv7" # kodi
license="GPL-2.0-only"
makedepends="cmake lame-dev kodi-dev"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/xbmc/audioencoder.lame/archive/$pkgver-$_realname.tar.gz"
builddir="$srcdir/audioencoder.lame-$pkgver-$_realname"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi \
		-DUSE_LTO=1
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

sha512sums="
1dc63fa652101ca4e03c305d05a9c406511400540c74e6a783aab6f0ee5a70ac137f6cf4ecb7b65878711fc6559d3f4ebdc6cd32a01d5d6d918893774163d054  kodi-audioencoder-lame-19.1.2-Matrix.tar.gz
"
